package com.jian.mall.order.vo;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class CartItem {
    private Long skuId;
    private String title;
    private String image;
    private Boolean checked;
    private Integer number;
    private BigDecimal price;
    private BigDecimal totalPrice;

    private List<String> attrs;

    public BigDecimal getTotalPrice() {
        if (number != null && price != null)
            return new BigDecimal(price.multiply(new BigDecimal(number)).toString());
        return new BigDecimal(0);
    }
}
